﻿using QWManage.Utils;
using System;
using System.Windows.Forms;

namespace QWManage.Forms
{
    public partial class FrmGroupTimer : Form
    {
        public int Interval { set; get; }
        public FrmGroupTimer()
        {
            InitializeComponent();
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            int interval;
            if (!int.TryParse(txtInterval.Text, out interval) || interval <= 0)
            {
                Common.MessageBoxWarning("无效数字");
                txtInterval.SelectAll();
                txtInterval.Focus();
                return;
            }
            Interval = interval;
            DialogResult = DialogResult.OK;
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }

        private void FrmGroupTimer_Load(object sender, EventArgs e)
        {
            txtInterval.TextAlign = HorizontalAlignment.Center;
            txtInterval.Text = "10";
        }
    }
}
